Skip to content

[Discover][APM] Detect OTEL spans for doc viewer#224439

Merged
Bluefinger merged 3 commits intoelastic:mainfrom
Bluefinger:processor-event-otel-fallbacks
Jun 19, 2025
Merged

[Discover][APM] Detect OTEL spans for doc viewer#224439
Bluefinger merged 3 commits intoelastic:mainfrom
Bluefinger:processor-event-otel-fallbacks

Conversation

@Bluefinger
Copy link
Copy Markdown
Contributor

@Bluefinger Bluefinger commented Jun 18, 2025

Summary

This PR modifies the Span doc viewer check to be better equipped for dealing with unprocessed OTEL trace spans. If there is no processed.event field, we can start assuming there'd be OTEL specific fields to check. Here, we check for kind which should be present, so any value determines this to be a trace span. In the absence of kind being present and no processed.event field (just a data_stream.type field, we can assume it is a span regardless.

Related to #221521

How to test

  • Add the following to your kibana.dev.yml file:
discover.experimental.enabledProfiles:
  - observability-traces-data-source-profile
  - observability-traces-transaction-document-profile
  - observability-traces-span-document-profile
  • Set up a source of unprocessed OTEL data to feed into ES (Open telemetry demo, etc)
  • Set your space to Observability mode, and go to Discover.
  • Query for traces-* and open any record for the document viewer
  • The Span Overview tab should be visible.

@Bluefinger Bluefinger added release_note:skip Skip the PR/issue when compiling release notes v9.0.0 Team:obs-ux-infra_services - DEPRECATED DEPRECATED - Use Team:obs-presentation. backport:version Backport to applied version labels v8.19.0 labels Jun 18, 2025
@Bluefinger
Copy link
Copy Markdown
Contributor Author

/ci

@Bluefinger
Copy link
Copy Markdown
Contributor Author

/ci

@Bluefinger Bluefinger marked this pull request as ready for review June 18, 2025 17:43
@Bluefinger Bluefinger requested a review from a team June 18, 2025 17:43
@Bluefinger Bluefinger requested a review from a team as a code owner June 18, 2025 17:43
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/discover-utils 312 313 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
discover 1.1MB 1.1MB +56.0B
Unknown metric groups

API count

id before after diff
@kbn/discover-utils 362 363 +1

Copy link
Copy Markdown
Contributor

@iblancof iblancof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes LGTM

@Bluefinger Bluefinger enabled auto-merge (squash) June 19, 2025 13:56
@Bluefinger Bluefinger merged commit c88328f into elastic:main Jun 19, 2025
10 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.19, 9.0

https://github.com/elastic/kibana/actions/runs/15762016888

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 19, 2025
## Summary

This PR modifies the Span doc viewer check to be better equipped for
dealing with unprocessed OTEL trace spans. If there is no
`processed.event` field, we can start assuming there'd be OTEL specific
fields to check. Here, we check for `kind` which *should* be present, so
any value determines this to be a trace span. In the absence of `kind`
being present and no `processed.event` field (just a `data_stream.type`
field, we can assume it is a span regardless.

## How to test

* Add the following to your `kibana.dev.yml` file:
```yaml
discover.experimental.enabledProfiles:
  - observability-traces-data-source-profile
  - observability-traces-transaction-document-profile
  - observability-traces-span-document-profile
```
* Set up a source of unprocessed OTEL data to feed into ES (Open
telemetry demo, etc)
* Set your space to Observability mode, and go to Discover.
* Query for `traces-*` and open any record for the document viewer
* The Span Overview tab should be visible.

(cherry picked from commit c88328f)
@kibanamachine
Copy link
Copy Markdown
Contributor

💔 Some backports could not be created

Status Branch Result
8.19
9.0 Backport failed because of merge conflicts

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 224439

Questions ?

Please refer to the Backport tool documentation

@iblancof
Copy link
Copy Markdown
Contributor

Why are we backporting to 9.0 @Bluefinger?

kibanamachine added a commit that referenced this pull request Jun 19, 2025
…24608)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Discover][APM] Detect OTEL spans for doc viewer
(#224439)](#224439)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Gonçalo Rica Pais da
Silva","email":"goncalo.rica@elastic.co"},"sourceCommit":{"committedDate":"2025-06-19T16:01:54Z","message":"[Discover][APM]
Detect OTEL spans for doc viewer (#224439)\n\n## Summary\n\nThis PR
modifies the Span doc viewer check to be better equipped for\ndealing
with unprocessed OTEL trace spans. If there is no\n`processed.event`
field, we can start assuming there'd be OTEL specific\nfields to check.
Here, we check for `kind` which *should* be present, so\nany value
determines this to be a trace span. In the absence of `kind`\nbeing
present and no `processed.event` field (just a
`data_stream.type`\nfield, we can assume it is a span
regardless.\n\n\n## How to test\n\n* Add the following to your
`kibana.dev.yml`
file:\n```yaml\ndiscover.experimental.enabledProfiles:\n -
observability-traces-data-source-profile\n -
observability-traces-transaction-document-profile\n -
observability-traces-span-document-profile\n```\n* Set up a source of
unprocessed OTEL data to feed into ES (Open\ntelemetry demo, etc)\n* Set
your space to Observability mode, and go to Discover.\n* Query for
`traces-*` and open any record for the document viewer\n* The Span
Overview tab should be
visible.","sha":"c88328f2902564dfd283690ecfe9ed6384901837","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:obs-ux-infra_services","backport:version","v9.1.0","v8.19.0"],"title":"[Discover][APM]
Detect OTEL spans for doc
viewer","number":224439,"url":"https://github.com/elastic/kibana/pull/224439","mergeCommit":{"message":"[Discover][APM]
Detect OTEL spans for doc viewer (#224439)\n\n## Summary\n\nThis PR
modifies the Span doc viewer check to be better equipped for\ndealing
with unprocessed OTEL trace spans. If there is no\n`processed.event`
field, we can start assuming there'd be OTEL specific\nfields to check.
Here, we check for `kind` which *should* be present, so\nany value
determines this to be a trace span. In the absence of `kind`\nbeing
present and no `processed.event` field (just a
`data_stream.type`\nfield, we can assume it is a span
regardless.\n\n\n## How to test\n\n* Add the following to your
`kibana.dev.yml`
file:\n```yaml\ndiscover.experimental.enabledProfiles:\n -
observability-traces-data-source-profile\n -
observability-traces-transaction-document-profile\n -
observability-traces-span-document-profile\n```\n* Set up a source of
unprocessed OTEL data to feed into ES (Open\ntelemetry demo, etc)\n* Set
your space to Observability mode, and go to Discover.\n* Query for
`traces-*` and open any record for the document viewer\n* The Span
Overview tab should be
visible.","sha":"c88328f2902564dfd283690ecfe9ed6384901837"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.19"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/224439","number":224439,"mergeCommit":{"message":"[Discover][APM]
Detect OTEL spans for doc viewer (#224439)\n\n## Summary\n\nThis PR
modifies the Span doc viewer check to be better equipped for\ndealing
with unprocessed OTEL trace spans. If there is no\n`processed.event`
field, we can start assuming there'd be OTEL specific\nfields to check.
Here, we check for `kind` which *should* be present, so\nany value
determines this to be a trace span. In the absence of `kind`\nbeing
present and no `processed.event` field (just a
`data_stream.type`\nfield, we can assume it is a span
regardless.\n\n\n## How to test\n\n* Add the following to your
`kibana.dev.yml`
file:\n```yaml\ndiscover.experimental.enabledProfiles:\n -
observability-traces-data-source-profile\n -
observability-traces-transaction-document-profile\n -
observability-traces-span-document-profile\n```\n* Set up a source of
unprocessed OTEL data to feed into ES (Open\ntelemetry demo, etc)\n* Set
your space to Observability mode, and go to Discover.\n* Query for
`traces-*` and open any record for the document viewer\n* The Span
Overview tab should be
visible.","sha":"c88328f2902564dfd283690ecfe9ed6384901837"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Gonçalo Rica Pais da Silva <goncalo.rica@elastic.co>
@Bluefinger Bluefinger removed the v9.0.0 label Jun 20, 2025
@Bluefinger
Copy link
Copy Markdown
Contributor Author

Why are we backporting to 9.0 @Bluefinger?

Oopsie, my mistake here! Removed the label

akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request Jun 25, 2025
## Summary

This PR modifies the Span doc viewer check to be better equipped for
dealing with unprocessed OTEL trace spans. If there is no
`processed.event` field, we can start assuming there'd be OTEL specific
fields to check. Here, we check for `kind` which *should* be present, so
any value determines this to be a trace span. In the absence of `kind`
being present and no `processed.event` field (just a `data_stream.type`
field, we can assume it is a span regardless.


## How to test

* Add the following to your `kibana.dev.yml` file:
```yaml
discover.experimental.enabledProfiles:
  - observability-traces-data-source-profile
  - observability-traces-transaction-document-profile
  - observability-traces-span-document-profile
```
* Set up a source of unprocessed OTEL data to feed into ES (Open
telemetry demo, etc)
* Set your space to Observability mode, and go to Discover.
* Query for `traces-*` and open any record for the document viewer
* The Span Overview tab should be visible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services - DEPRECATED DEPRECATED - Use Team:obs-presentation. v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants